package com.example.hotel_lxy.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.example.hotel_lxy.R;
import com.example.hotel_lxy.application.ARouterPath;
import com.ysxsoft.common_base.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 关于我们
 */
@Route(path = "/main/AboutActivity")
public class AboutActivity extends BaseActivity implements View.OnClickListener {

    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.text1)
    TextView text1;
    @BindView(R.id.text2)
    TextView text2;

    public static void start() {
        ARouter.getInstance().build(ARouterPath.getAboutActivity())
                .navigation();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_about;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @Override
    public void doWork() {
        super.doWork();
        back.setOnClickListener(this);
        text1.setOnClickListener(this);
        text2.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.text1:
                WebActivity.start("http://api.luxiaoyi.vip/about/1.html","用户协议");
                break;
            case R.id.text2:
                WebActivity.start("http://api.luxiaoyi.vip/about/2.html","隐私协议");
                break;
        }
    }
}